package com.example.demo1.biz;

import com.badger.common.result.Response;
import com.example.demo1.api.DemoFacade;
import com.example.demo1.sal.DemoRepo;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Random;

@Service
public class DemoFacadeImpl implements DemoFacade {

    @Resource
    DemoRepo demoRepo;
    @Override
    public Response getTest(int i) {
        Random random = new Random(2);
        int a = random.nextInt();
        if(a==1) {
            return Response.success(demoRepo.testSuccess());
        }
        return Response.success(demoRepo.testSysFail());
    }
}
